using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_BCodeRelationMap : EntityTypeConfiguration<t_BCodeRelation>
    {
        public t_BCodeRelationMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FBCodeItemId, t.FDestSceneId });

            // Properties
            this.Property(t => t.FBCodeItemId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FDestSceneId)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FFieldName)
                .HasMaxLength(50);

            this.Property(t => t.FDestTable)
                .HasMaxLength(80);

            // Table & Column Mappings
            this.ToTable("t_BCodeRelation");
            this.Property(t => t.FBCodeItemId).HasColumnName("FBCodeItemId");
            this.Property(t => t.FDestSceneId).HasColumnName("FDestSceneId");
            this.Property(t => t.FDestId).HasColumnName("FDestId");
            this.Property(t => t.FFieldName).HasColumnName("FFieldName");
            this.Property(t => t.FDestTable).HasColumnName("FDestTable");
        }
    }
}
